import AccessEnum from '@/access/accessEnum'
import type { RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: () => import('@/pages/HomePage.vue'),
  },
  {
    path: '/user/login',
    name: '用户登录',
    component: () => import('@/pages/user/UserLoginPage.vue'),
  },
  {
    path: '/user/register',
    name: '用户注册',
    component: () => import('@/pages/user/UserRegisterPage.vue'),
  },
  {
    path: '/admin/userManage',
    name: '用户管理',
    component: () => import('@/pages/admin/UserManagePage.vue'),
    meta: {
      access: AccessEnum.ADMIN,
    },
  },
  {
    path: '/add_picture',
    name: '创建图片',
    component: () => import('@/pages/picture/AddPicture.vue'),
  },
  {
    path: '/add_picture/batch',
    name: '批量创建图片',
    component: () => import('@/pages/picture/AddPictureBatch.vue'),
  },
  {
    path: '/admin/pictureManage',
    name: '图片管理',
    component: () => import('@/pages/admin/PictureManagePage.vue'),
  },
  {
    path: '/admin/spaceManage',
    name: '空间管理',
    component: () => import('@/pages/admin/SpaceManagePage.vue'),
  },
  {
    path: '/add_space',
    name: '创建空间',
    component: () => import('@/pages/space/AddSpace.vue'),
  },
  {
    path: '/my_space',
    name: '我的空间',
    component: () => import('@/pages/space/MySpacePage.vue'),
  },
  {
    path: '/space/:id',
    name: '空间详情',
    component: () => import('@/pages/space/SpaceDetailPage.vue'),
    props: true,
  },
  {
    path: '/picture/:id',
    name: '图片详情',
    component: () => import('@/pages/picture/PictureDetailPage.vue'),
    props: true,
  },
  {
    path: '/search_picture',
    name: '图片搜索',
    component: () => import('@/pages/picture/PictureSearchPage.vue'),
  },
]

export default routes
